// 使用 A + 0.5 | 0 来替代 Math.round()
let a = 24.7;
console.log(a+0.5|0);
console.log(Math.round(24.5))
// 使用数字来做为 split 的分隔条件可以节省2字节
// --- before ---
"alpha,bravo,charlie".split(",");

// --- after ---
"alpha0bravo0charlie".split(0);
//使用.link() 创建链接
// --- before ---
let b1 = `<a herf="www.google.com">google</a>`;

// --- after ---
let b2 = 'google'.link('www.google.com');
// Array 重复数组
// --- before ---
for (let a = "", i = 7; i--;) a+= 0;

// --- after ---
let b = Array(7).join(0); // "000000"
let c = Array(7).join('La') // "LaLaLaLaLaLa"

// ES6
let d = "0".repeat(7); // "0000000"
// Array.slice() 深拷贝
let arr = [1,2,3,4,5,6];
let arry = arr.slice(0);
arry[0] = 9;
console.log(arr,arry)
